<!--
  - Copyright (C) 2018-2019
  - All rights reserved, Designed By www.samfeng.com
  - 注意：
  - 本软件为www.samfeng.com开发研制，项目使用请保留此说明
-->
<template>
  <div>
    <avue-crud ref="location"
               :page="page"
               :data="tableData"
               :table-loading="tableLoading"
               :option="StockLocationOption"
               v-model="stockLocationform"
               :before-close="closeDialog"
               @on-load="getStockLocationPage"
               @selection-change="locationSelectionChange"
               @refresh-change="refreshStockLocationChange">
    </avue-crud>
    <el-row class="pt15">
      <el-col  style="float:right">     
          <el-button size="small" type="primary" @click.native="selectClick" icon="el-icon-check">确定</el-button>
          <el-button size="small" @click.native="closeClick" icon="el-icon-close">取消</el-button>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import {StockLocationOption} from '@/const/crud/erp/stockLocation'
  export default {
    name: 'stockLocationSelect',
    data() {
      return {
        StockLocationOption:StockLocationOption
      }
    },
    props: {
      stockLocationform: null,
      tableData: null,
      tableLoading: null,
      page: null,
      paramsSearch: null,
    },
    methods: {
      closeDialog() {
        this.$emit('closeDialog')
      },
      selectClick() {
        this.$emit('selectClick')
      },
      closeClick() {
         this.$emit('closeClick')
      },
      locationSelectionChange(row){
        this.$emit('locationSelectionChange', row)      
      },     
      getStockLocationPage(page, params) {
        this.$emit('getStockLocationPage', {page, params})
      },
      /**
       * 刷新回调
       */
      refreshStockLocationChange(page) {
        this.$emit('refreshStockLocationChange', {page})
        // this.getPage(this.page)
      }
    }
  }
</script>
